class FriendsHome extends Scene{
    private dialogList:eui.List;
    private sourceArr:any[];
    private send:eui.Image;
    private name_input:eui.TextInput;
    private myScr:eui.Scroller;
    private danmu:eui.Image;
    private FriendHomeBack:eui.Image;
    private currentDia:any;
    public constructor(){
        super();
        this.sourceArr=[];
        this.currentDia=0;
    }
    public onSkinLoaded():void{
        this.send.addEventListener(egret.TouchEvent.TOUCH_TAP,this.btnHandler,this);
        this.danmu.addEventListener(egret.TouchEvent.TOUCH_TAP,this.btnHandler,this);
        this.FriendHomeBack.addEventListener(egret.TouchEvent.TOUCH_TAP,this.btnHandler,this);
    }
     private btnHandler(evt: egret.TouchEvent) {
        let btnFocused = evt.currentTarget;        
		    switch (btnFocused) {
                case this.FriendHomeBack:
                    SceneManager.instance.removeScene(this);
                    break;
                case this.send:
                    this.sourceArr.push({label:this.name_input.textDisplay.text,pic_num:1+Math.floor(Math.random()*4)});
                    this.dialogList.dataProvider=new eui.ArrayCollection(this.sourceArr);
                    this.dialogList.itemRenderer=MessageRenderer;
                    break;
                case this.danmu:
                   this.myScr.visible=true;
                   break;
        }
      }
}